package art.shared.entities;

import com.google.gwt.user.client.rpc.IsSerializable;

public class LoginInfo implements IsSerializable {

	private boolean loggedIn;
	private String loginUrl;
	private String logoutUrl;
	private String emailAddress;
	private String token;
	private UserShared user;

	public boolean isLoggedIn() {
		return loggedIn;
	}

	public void setLoggedIn(boolean loggedIn) {
		this.loggedIn = loggedIn;
	}

	public String getLoginUrl() {
		return loginUrl;
	}

	public void setLoginUrl(String loginUrl) {
		this.loginUrl = loginUrl;
	}

	public String getLogoutUrl() {
		return logoutUrl;
	}

	public void setLogoutUrl(String logoutUrl) {
		this.logoutUrl = logoutUrl;
	}

	public String getEmailAddress() {
		return emailAddress;
	}

	public void setEmailAddress(String emailAddress) {
		this.emailAddress = emailAddress;
	}

	public UserLevelShared getUserLevel() {
		if (user == null | !isLoggedIn()) {
			return UserLevelShared.VISITOR;
		}
		return user.getLevel();
	}

	public UserShared getUser() {
		return user;
	}

	public void setUser(UserShared user) {
		this.user = user;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

}
